#version 450

layout(location = 0) in vec3 in_position;
layout(location = 1) in vec2 in_texcoord;
layout(location = 2) in vec3 in_normal;

out gl_PerVertex
{
    vec4 gl_Position;
};

layout(set = 0, binding = 0, std140) uniform GlobalUBO
{
    mat4 projMatrix;
    mat4 viewMatrix;
} globalUBO;

layout(set = 0, binding = 1, std140) uniform InstanceUBO
{
    mat4 modelMatrix;
} instanceUBO;

out layout(location = 1) vec2 out_texcoord;

void main()
{
    //FIXME projMatrix[1][1] *= -1.f;   兼容OpenGL和Vulkan的差异，
    gl_Position = globalUBO.projMatrix * globalUBO.viewMatrix * instanceUBO.modelMatrix * vec4(in_position, 1.f);
    out_texcoord = in_texcoord;
}